﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>checkbox</title>
    <link rel="stylesheet" href="../css/bootstrap.css"/>
    <script src="../js/jquery-2.2.0.min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
</head>
<body>
    <h1>checkbox</h1><br/>

    <div id="app">
        {{name}}
        <!--如果是复选框 只有一个复选框的时候，会把此值转化成boolean类型，true表示选中-->
        <input type="checkbox" v-model="a">{{a}}<br/>
        <!--如果是多个,要添加value属性，并且数据类型为数组-->
        爱好:{{b}}
        <input type="checkbox" v-model="b" value="游泳">游泳
        <input type="checkbox" v-model="b" value="爬山">爬山
        <input type="checkbox" v-model="b" value="睡觉">睡觉
    </div>
<script src="../js/vue-2.5.16.js"></script>
<script src="../node_modules/axios/dist/axios.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>

<script>
    var app = new Vue({
        el:'#app',
        data:{
            name:'模版数据',
            a:true,
            b:[]
        }
    });
</script>

</body>
</html>